// @author: caoshi
// @date: 2021-05-21 21:18
// 响应实体, 为接口返回的统一的数据格式!
package resp

type ResultBean struct {
	Code int         `json:"code"`
	Msg  string      `json:"msg"`
	Obj  interface{} `json:"obj"`
}

func Ok(msg string, obj interface{}) ResultBean {
	return ResultBean{
		Code: 200,
		Msg:  msg,
		Obj:  obj,
	}
}

func Error(msg string, obj interface{}) ResultBean {
	return ResultBean{
		Code: 500,
		Msg:  msg,
		Obj:  obj,
	}
}
